package com.zlyx.easy.access.defaults;

import java.lang.reflect.Method;

import com.zlyx.easy.access.abstracts.AbstractSqlAssembler;
import com.zlyx.easy.core.map.ObjectMap;
import com.zlyx.easy.core.tool.EasyBuffer;

public class DefaultSqlAssembler extends AbstractSqlAssembler {

	public DefaultSqlAssembler(Class<?> tClass, Method method, ObjectMap params) throws Exception {
		super(tClass, method, params);
	}

	@Override
	public String assemble(ObjectMap paramsMap, String sql) {
		for (String key : paramsMap.keySet()) {
			sql = sql.replace(EasyBuffer.wrapper("${", key, "}"), key);
			sql = sql.replace(EasyBuffer.wrapper("#{", key, "}"), key);
		}
		return sql;
	}
}